//
//  QZTime.m
//  WeiWeiHaircut
//
//  Created by 上官惠阳 on 15/12/4.
//  Copyright © 2015年 超群. All rights reserved.
//

#import "QZTime.h"

@implementation QZTime
+ (NSString* )getNowTime
{
    NSDate *date = [NSDate date];
    NSDateFormatter *dateformat=[[NSDateFormatter alloc] init];
    [dateformat setDateFormat:@"yyyy-MM-dd HH:mm:ss"];
    NSString *destDateString = [dateformat stringFromDate:date];
    return destDateString;
}
+ (NSDate *)dateFromString:(NSString *)dateString withFormat:(NSString *)format{
    NSDateFormatter *dateFormatter = [[NSDateFormatter alloc] init];
    [dateFormatter setDateFormat: format];
    NSDate *destDate= [dateFormatter dateFromString:dateString];
    return destDate;
}

+ (NSString *)stringFromDate:(NSDate *)date withFormat:(NSString *)format{
    NSDateFormatter *dateFormatter = [[NSDateFormatter alloc] init];
    [dateFormatter setDateFormat:format];
    NSString *destDateString = [dateFormatter stringFromDate:date];
    return destDateString;
}
//获取时间戳
+ (long)getTimeSpetWithDate:(NSDate *)date
{
    return [date timeIntervalSince1970];
}
@end
